"""
@-*- coding: utf-8 -*-
@ python: 3.12.3
@ 创建者: JacksonCode
@ 创建时间: 2025-11-06
@ 描述: 认证相关API路由
"""
from flask import Blueprint
from app.controllers.auth import AuthController

# 创建认证蓝图
auth_bp = Blueprint('auth', __name__, url_prefix='/auth')


@auth_bp.route("/login", methods=["POST"])
def login():
    """用户登录"""
    return AuthController.login()


@auth_bp.route("/register", methods=["POST"])
def register():
    """用户注册"""
    return AuthController.register()


@auth_bp.route("/me", methods=["GET"])
def get_current_user():
    """获取当前用户信息"""
    return AuthController.get_current_user()


@auth_bp.route("/profile", methods=["PUT"])
def update_profile():
    """更新用户资料"""
    return AuthController.update_profile()


@auth_bp.route("/refresh", methods=["POST"])
def refresh():
    """刷新访问令牌"""
    return AuthController.refresh()


@auth_bp.route("/logout", methods=["POST"])
def logout():
    """用户登出"""
    return AuthController.logout()